package cn.js.ccit.service;

import java.util.List;

import cn.js.ccit.dao.IMeetingDAO;
import cn.js.ccit.mapper.MeetingMapper;
import cn.js.ccit.pojo.Meeting;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MeetingService implements IMeetingService{
	@Autowired
	private IMeetingDAO meetingDAO;

	@Autowired
	private MeetingMapper meetingMapper;

	public void addMeeting(Meeting meeting) {
		meetingDAO.addMeeting(meeting);
	}

	public IMeetingDAO getMeetingDAO() {
		return meetingDAO;
	}

	public void setMeetingDAO(IMeetingDAO meetingDAO) {
		this.meetingDAO = meetingDAO;
	}

	public List getAllMeeting() {

		return meetingDAO.getAllMeeting();
	}

	public boolean approvalMeeting(Meeting meeting) {

		return meetingDAO.approvalMeeting(meeting);
	}

	public List queryMeeting(String title, String departMent) {

		return meetingDAO.queryMeeting(title, departMent);
	}

	@Override
	public List<Meeting> queryMeetingByMyBatis(String title, String departMent) {
		return meetingMapper.queryMeeting(title,departMent);
	}

	public Meeting getMeetingById(int id) {

		return meetingDAO.getMeetingById(id);
	}
}
